<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>spade.xmpp.commands.Command_Handler_Prototype</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="spade-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            ><a class="navbar" target="_top" href="http://spade2.googlecode.com">SPADE</a></th>
          </tr></table></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        <a href="spade-module.html">Package&nbsp;spade</a> ::
        <a href="spade.xmpp-module.html">Package&nbsp;xmpp</a> ::
        <a href="spade.xmpp.commands-module.html">Module&nbsp;commands</a> ::
        Class&nbsp;Command_Handler_Prototype
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
        <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
    onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
        <tr><td align="right"><span class="options"
            >[<a href="frames.html" target="_top">frames</a
            >]&nbsp;|&nbsp;<a href="spade.xmpp.commands.Command_Handler_Prototype-class.html"
            target="_top">no&nbsp;frames</a>]</span></td></tr>
      </table>
    </td>
  </tr>
</table>
<!-- ==================== CLASS DESCRIPTION ==================== -->
<h1 class="epydoc">Class Command_Handler_Prototype</h1><p class="nomargin-top"><span class="codelink"><a href="spade.xmpp.commands-pysrc.html#Command_Handler_Prototype">source&nbsp;code</a></span></p>
<center>
<center>  <map id="uml_class_diagram_for_spade_xm_11" name="uml_class_diagram_for_spade_xm_11">
<area shape="rect" id="node2502" href="spade.xmpp.commands.Command_Handler_Prototype-class.html#name" title="spade.xmpp.commands.Command_Handler_Prototype.name" alt="" coords="31,145,208,164"/>
<area shape="rect" id="node2502" href="spade.xmpp.commands.Command_Handler_Prototype-class.html#count" title="spade.xmpp.commands.Command_Handler_Prototype.count" alt="" coords="31,164,208,183"/>
<area shape="rect" id="node2502" href="spade.xmpp.commands.Command_Handler_Prototype-class.html#description" title="spade.xmpp.commands.Command_Handler_Prototype.description" alt="" coords="31,183,208,201"/>
<area shape="rect" id="node2502" href="spade.xmpp.commands.Command_Handler_Prototype-class.html#discofeatures" title="spade.xmpp.commands.Command_Handler_Prototype.discofeatures" alt="" coords="31,201,208,220"/>
<area shape="rect" id="node2502" href="spade.xmpp.commands.Command_Handler_Prototype-class.html#__init__" title="Set up the class" alt="" coords="31,223,208,241"/>
<area shape="rect" id="node2502" href="spade.xmpp.commands.Command_Handler_Prototype-class.html#plugin" title="Plug command into the commands class" alt="" coords="31,241,208,260"/>
<area shape="rect" id="node2502" href="spade.xmpp.commands.Command_Handler_Prototype-class.html#plugout" title="Remove command from the commands class" alt="" coords="31,260,208,279"/>
<area shape="rect" id="node2502" href="spade.xmpp.commands.Command_Handler_Prototype-class.html#getSessionID" title="Returns an id for the command session" alt="" coords="31,279,208,297"/>
<area shape="rect" id="node2502" href="spade.xmpp.commands.Command_Handler_Prototype-class.html#Execute" title="The method that handles all the commands, and routes them to the correct &#160;method for that stage." alt="" coords="31,297,208,316"/>
<area shape="rect" id="node1" href="spade.xmpp.commands.Command_Handler_Prototype-class.html" title="This is a prototype command handler, as each command uses a disco method and execute method you can implement it any way you like, however this is my first attempt at making a generic handler that you can hang process stages on too." alt="" coords="19,121,219,322"/>
<area shape="rect" id="node3" href="spade.xmpp.commands.TestCommand-class.html" title="Example class." alt="" coords="59,342,181,381"/>
<area shape="rect" id="node2503" href="spade.xmpp.client.PlugIn-class.html#DEBUG" title="Feed a provided debug line to main instance&#39;s debug facility along with our ID string." alt="" coords="17,39,221,57"/>
<area shape="rect" id="node2503" href="spade.xmpp.client.PlugIn-class.html#PlugIn" title="Attach to main instance and register ourself and all our staff in it." alt="" coords="17,57,221,76"/>
<area shape="rect" id="node2503" href="spade.xmpp.client.PlugIn-class.html#PlugOut" title="Unregister all our staff from main instance and detach from it." alt="" coords="17,76,221,95"/>
<area shape="rect" id="node2" href="spade.xmpp.client.PlugIn-class.html" title="Common xmpppy plugins infrastructure: plugging in/out, debugging." alt="" coords="5,6,232,101"/>
</map>
  <img src="uml_class_diagram_for_spade_xm_11.gif" alt='' usemap="#uml_class_diagram_for_spade_xm_11" ismap="ismap" class="graph-without-title" />
</center>
</center>
<hr />
<pre class="literalblock">
This is a prototype command handler, as each command uses a disco method 
   and execute method you can implement it any way you like, however this is 
   my first attempt at making a generic handler that you can hang process 
   stages on too. There is an example command below.

The parameters are as follows:
name : the name of the command within the jabber environment
description : the natural language description
discofeatures : the features supported by the command
initial : the initial command in the from of {'execute':commandname}

All stages set the 'actions' dictionary for each session to represent the possible options available.

</pre>

<!-- ==================== INSTANCE METHODS ==================== -->
<a name="section-InstanceMethods"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Instance Methods</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-InstanceMethods"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="spade.xmpp.commands.Command_Handler_Prototype-class.html#__init__" class="summary-sig-name">__init__</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">jid</span>=<span class="summary-sig-default"><code class="variable-quote">'</code><code class="variable-string"></code><code class="variable-quote">'</code></span>)</span><br />
      Set up the class</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="spade.xmpp.commands-pysrc.html#Command_Handler_Prototype.__init__">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="plugin"></a><span class="summary-sig-name">plugin</span>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">owner</span>)</span><br />
      Plug command into the commands class</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="spade.xmpp.commands-pysrc.html#Command_Handler_Prototype.plugin">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="plugout"></a><span class="summary-sig-name">plugout</span>(<span class="summary-sig-arg">self</span>)</span><br />
      Remove command from the commands class</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="spade.xmpp.commands-pysrc.html#Command_Handler_Prototype.plugout">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="getSessionID"></a><span class="summary-sig-name">getSessionID</span>(<span class="summary-sig-arg">self</span>)</span><br />
      Returns an id for the command session</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="spade.xmpp.commands-pysrc.html#Command_Handler_Prototype.getSessionID">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="Execute"></a><span class="summary-sig-name">Execute</span>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">conn</span>,
        <span class="summary-sig-arg">request</span>)</span><br />
      The method that handles all the commands, and routes them to the 
      correct method for that stage.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="spade.xmpp.commands-pysrc.html#Command_Handler_Prototype.Execute">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr class="private">
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="_DiscoHandler"></a><span class="summary-sig-name">_DiscoHandler</span>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">conn</span>,
        <span class="summary-sig-arg">request</span>,
        <span class="summary-sig-arg">type</span>)</span><br />
      The handler for discovery events</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="spade.xmpp.commands-pysrc.html#Command_Handler_Prototype._DiscoHandler">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
  <tr>
    <td colspan="2" class="summary">
    <p class="indent-wrapped-lines"><b>Inherited from <code><a href="spade.xmpp.client.PlugIn-class.html">client.PlugIn</a></code></b>:
      <code><a href="spade.xmpp.client.PlugIn-class.html#DEBUG">DEBUG</a></code>,
      <code><a href="spade.xmpp.client.PlugIn-class.html#PlugIn">PlugIn</a></code>,
      <code><a href="spade.xmpp.client.PlugIn-class.html#PlugOut">PlugOut</a></code>
      </p>
    </td>
  </tr>
</table>
<!-- ==================== CLASS VARIABLES ==================== -->
<a name="section-ClassVariables"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Class Variables</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-ClassVariables"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="name"></a><span class="summary-name">name</span> = <code title="'examplecommand'"><code class="variable-quote">'</code><code class="variable-string">examplecommand</code><code class="variable-quote">'</code></code>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="count"></a><span class="summary-name">count</span> = <code title="0">0</code>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="description"></a><span class="summary-name">description</span> = <code title="'an example command'"><code class="variable-quote">'</code><code class="variable-string">an example command</code><code class="variable-quote">'</code></code>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="spade.xmpp.commands.Command_Handler_Prototype-class.html#discofeatures" class="summary-name">discofeatures</a> = <code title="['http://jabber.org/protocol/commands', 'jabber:x:data']"><code class="variable-group">[</code><code class="variable-quote">'</code><code class="variable-string">http://jabber.org/protocol/commands</code><code class="variable-quote">'</code><code class="variable-op">, </code><code class="variable-quote">'</code><code class="variable-string">jabbe</code><code class="variable-ellipsis">...</code></code>
    </td>
  </tr>
</table>
<!-- ==================== METHOD DETAILS ==================== -->
<a name="section-MethodDetails"></a>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Method Details</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-MethodDetails"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
</table>
<a name="__init__"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">jid</span>=<span class="sig-default"><code class="variable-quote">'</code><code class="variable-string"></code><code class="variable-quote">'</code></span>)</span>
    <br /><em class="fname">(Constructor)</em>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="spade.xmpp.commands-pysrc.html#Command_Handler_Prototype.__init__">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Set up the class</p>
  <dl class="fields">
    <dt>Overrides:
        <a href="spade.xmpp.client.PlugIn-class.html#__init__">client.PlugIn.__init__</a>
    </dt>
  </dl>
</td></tr></table>
</div>
<br />
<!-- ==================== CLASS VARIABLE DETAILS ==================== -->
<a name="section-ClassVariableDetails"></a>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Class Variable Details</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-ClassVariableDetails"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
</table>
<a name="discofeatures"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <h3 class="epydoc">discofeatures</h3>
  
  <dl class="fields">
  </dl>
  <dl class="fields">
    <dt>Value:</dt>
      <dd><table><tr><td><pre class="variable">
<code class="variable-group">[</code><code class="variable-quote">'</code><code class="variable-string">http://jabber.org/protocol/commands</code><code class="variable-quote">'</code><code class="variable-op">, </code><code class="variable-quote">'</code><code class="variable-string">jabber:x:data</code><code class="variable-quote">'</code><code class="variable-group">]</code>
</pre></td></tr></table>
</dd>
  </dl>
</td></tr></table>
</div>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="spade-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            ><a class="navbar" target="_top" href="http://spade2.googlecode.com">SPADE</a></th>
          </tr></table></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    Generated by Epydoc 3.0.1 on Wed Aug  1 18:44:56 2012
    </td>
    <td align="right" class="footer">
      <a target="mainFrame" href="http://epydoc.sourceforge.net"
        >http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie();
  // -->
</script>
</body>
</html>
